import 'package:flutter/material.dart';

class MyApp06 extends StatefulWidget {
  const MyApp06({super.key});

  @override
  State<MyApp06> createState() => _MyApp06State();
}

class _MyApp06State extends State<MyApp06> {
  @override
  Widget build(BuildContext context) {
    //常量
    final screen = MediaQuery.of(context).size;

    return Scaffold(
      appBar: AppBar(
        title: Text('Container容器组件'),
        backgroundColor: Colors.pink,
        centerTitle: true, //标题是否居中
      ),
      body: Center(
        child: Container(
          width: screen.width, //占满宽
          height: MediaQuery.of(context).size.height / 2,
          padding: const EdgeInsets.all(20), //内边距
          color: Colors.blueAccent,
          child: Center(
            child: Container(
              width: 310,
              height: 310,
              //color: Colors.amber,
              child: Text('我是Container容器'),
              alignment: Alignment.bottomCenter,  //对齐方式
              margin: EdgeInsets.only(top: 20, left: 10, right: 10, bottom: 5),  //外边距
              decoration: BoxDecoration(
                color: Colors.amber,
                //borderRadius: BorderRadius.circular(20),
                borderRadius: BorderRadius.only(topLeft: Radius.circular(20),bottomRight: Radius.circular(40),bottomLeft:Radius.circular(3),topRight: Radius.circular(8)),//单独设置圆角
                // border: Border(
                //   top: BorderSide(color: Colors.red,width: 2)
                // )
                border: Border.all(
                color: Colors.red,width: 2)
                
                ),
            ),
          ),
        ),
      ),
    );
  }
}
